<?php
$footer = new ioMenu();

$countFooterList = count($footer_list);
if(!empty($footer_list) && $countFooterList > 0 )
{
    $tabFooter = array();
    foreach($footer_list as $key => $cat) {
        if(!isset($footer[$cat->title]) && empty($cat->category_parent_id)) {
            $footer->addChild($cat->title, $cat->link, array('class' => 'footer_level_0 num' . $key ));
            $tabFooter[] = array( "id" => $cat->id, "title" => $cat->title);
        }
    }

    foreach($footer_list as $key => $cat) {
        foreach($tabFooter as $key_parent => $cat_parent) {
            if($cat->category_parent_id == $cat_parent[ 'id' ]) {
                $link = url_for('@homepage') . $sf_user->getCulture() . $cat[ 'link' ];

                $footer[$cat_parent[ 'title' ]]->addChild($cat->title, $link, array());
            }
        }
    }
}

echo $footer->render();
?>